package com.ruoyi.system.mysql.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.system.mysql.domain.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

// Mapper接口（MyBatis-Plus）
@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select t1.* from user t1 join user_hzl t2 on t1.user_id = t2.user_id where t1.user_id = #{userId} and t2.user_id = #{userId} " )
    List<User> selectByUsername(Long userId);

    @Select("select t1.* from user t1 join user_hzl t2 on t1.user_id = t2.user_id where t1.user_id = #{userId}  " )
    List<User> selectByUsername1(Long userId);

    @Select("select t1.* from user t1 join user_hzl t2 on t1.user_id = t2.user_id where t2.user_id = #{userId} " )
    List<User> selectByUsername2(Long userId);

    @Select("select t1.* from user t1 join user_hzl t2 on t1.user_id = t2.user_id where t2.age = #{age} " )
    List<User> selectByUserAge(Integer age);
}